/****************************************************
	文件：ScriptTemplateData.cs
	作者：HuskyT
	邮箱：1005240602@qq.com
	日期：2020/12/19 22:27:5
	功能：脚本模板数据
*****************************************************/

using System;
using System.Collections.Generic;
using HTFW.Consts;
using UnityEngine;

namespace HTFW.Utility.Editor
{
    /// <summary>
    /// 脚本模板配置数据
    /// </summary>
    [CreateAssetMenu(fileName = "ScriptTemplateData", menuName = MenuPath.CREATE_SCRIPT_TEMPLATE_DATA, order = 1)]
    public class ScriptTemplateData : ScriptableObject
    {
        [Space] [Header("是否使用脚本模板")] public bool IsUsing = false;

        [Space] [Header("是否写入脚本头信息")] public bool WriteHead = false;

        [Space] [Header("使用者")] public ScriptTemplateUser User = ScriptTemplateUser.HuskyT;

        [Space] [Header("邮箱")] public string Mail = "1005240602@qq.com";

        [Space] [Header("使用的脚本模板ID")] public int UsingIndex = 0;

        [Space] [Header("模板")] public List<ScriptTemplateDataItem> ScriptTemplate = new List<ScriptTemplateDataItem>();
    }

    /// <summary>
    /// 单个脚本模板数据项
    /// </summary>
    [CreateAssetMenu(fileName = "ScriptTemplateDataItem", menuName = MenuPath.CREATE_SCRIPT_TEMPLATE_DATA_ITEM,
        order = 2)]
    public class ScriptTemplateDataItem : ScriptableObject
    {
        [Header("Using")] public List<string> UsingList = new List<string>() {"System", "UnityEngine"};

        [Header("命名空间")] public string NameSpace = "HTFramework";

        [Header("是否继承自 MonoBehaviour")] public bool IsMono = true;

        [Header("继承自")] public string Inherit = "";

        [Header("方法")] public List<FuncData> FuncList = new List<FuncData>();
    }

    /// <summary>
    /// 方法数据
    /// </summary>
    [Serializable]
    public class FuncData
    {
        public bool IsPublic = false;
        public bool IsStatic = false;
        public string ReturnString = "";
        public string FunctionName = "";
        public List<string> ParamList = new List<string>();
        public string InnerInfo = "";
    }

    /// <summary>
    /// 脚本模板使用者
    /// </summary>
    public enum ScriptTemplateUser
    {
        None,
        HuskyT,
    }
}